#include<bits/stdc++.h>
using namespace std;
int n,g;
int a[200010];
int main()
{
	freopen("color.in","r",stdin); 
	freopen("color.out","w",stdout); 
	cin>>n;
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);		
	sort(a+1,a+1+n);
	for(int i=1;i<=n;i++)if(a[i]==a[i-1])a[i-1]=-1;
	for(int i=1;i<=n;i++)if(a[i]!=-1)g++;
	cout<<n-1-g;
	
	return 0;
} 
